package org.thinker.util;

import java.io.UnsupportedEncodingException;

public class SearchUtil {

	public static String getChecked(String[] param, String type, String value, String defaultValue){
		
		if(param == null || param.length == 0){
			return defaultValue;
		}
		
		for(String str : param){
			if(str.equals(type)){
				return value;
			}
		}
		
		return defaultValue;
		
	}
	
	public static String decode(String value){
		if(value ==null || value.trim().length() == 0){
			return "";
		}
		try {
			return new String(value.getBytes("8859_1"), "euc-kr");
		} catch (UnsupportedEncodingException e) {
			return value;
		}
	}
	
}
